<template>
  <view class="container">

    <view class="certificate-content">
      <view class="info-item">
        <view class="info-label">订单编号</view>
        <view class="info-value">{{ orderInfo.order_no }}</view>
      </view>
      
      <view class="info-item">
        <view class="info-label">产品名称</view>
        <view class="info-value">{{ orderInfo.order_goods }}</view>
      </view>
      
      
      
      <view class="info-item">
        <view class="info-label">产品单价</view>
        <view class="info-value">¥{{ orderInfo.goods_price }}</view>
      </view>
	  
	  <view class="info-item" v-for="(item,index) in orderInfo.order_goods_attr" :key="index">
	    <view class="info-label">{{item.attr_name}}</view>
	    <view class="info-value">{{item.attr_value_name}}</view>
	  </view>
	  
	  
      
      <view class="info-item">
        <view class="info-label">购买数量</view>
        <view class="info-value">{{ orderInfo.buy_num }}</view>
      </view>
      
      <view class="info-item">
        <view class="info-label">订单金额</view>
        <view class="info-value highlight">¥{{ orderInfo.order_money }}</view>
      </view>
      
      <view class="info-item">
        <view class="info-label">收货地址</view>
        <view class="info-value">{{ orderInfo.order_address }}</view>
      </view>
      
      <view class="info-item">
        <view class="info-label">经营地址</view>
        <view class="info-value">{{ orderInfo.department_info.category_full_name }}</view>
      </view>
      
      <view class="info-item">
        <view class="info-label">联系电话</view>
        <view class="info-value">{{ orderInfo.department_info.contact_phone }}</view>
      </view>
      
      <view class="info-item">
        <view class="info-label">销售时间</view>
        <view class="info-value">{{ orderInfo.sale_time }}</view>
      </view>
    </view>
    
    <view style="height:50rpx;"></view>
  </view>
</template>

<script>
export default {
  name: 'pingzheng',
  data() {
    return {
      orderInfo: {
        orderNo: '75479920250715101602179',
        productName: '液体敷料',
        productCode: '1703552891919',
        productModel: '5ml/瓶 MB型 (小白瓶)',
        productSpec: '5ml/瓶',
        registrationNo: '浙绍械备20190196号',
        registrantName: '绍兴颜诺医疗科技有限公司',
        manufacturerName: '绍兴颜诺医疗科技有限公司',
        manufacturingLicense: '鲁济食药监械生产备20180017号',
        unitPrice: '268',
        quantity: '1',
        shipmentQuantity: '1',
        totalAmount: '265.32',
        pickupDoorNo: '005',
        businessAddress: '聊城市人民医院门诊2楼皮肤科',
        locationCode: 'YGG40604407063',
        contactPhone: '18765312107',
        salesTime: '2025-07-15 10:16:42'
      }
    }
  },
  onLoad(options) {
      this.loadOrderData(options.goods_id,options.order_id);
   
  },
  methods: {
    // 加载订单数据的方法
    loadOrderData(goodsId,orderId) {
		this.$api.sendRequest({
		  url: '/api/order/getOrderGoodsInfo',
		  data: {
		    goods_id:goodsId,
		    order_id:orderId
		  },
		  success: res => {
		    if (res.code == 0) {
		      this.orderInfo = res.data;
		    }
		  }
		});
    },
  }
}
</script>

<style scoped>
.container {
  padding: 20rpx;
  background-color: #f8f8f8;
  min-height: 100vh;
}

.header {
  text-align: center;
  padding: 30rpx 0;
  margin-bottom: 20rpx;
}

.title {
  font-size: 48rpx;
  font-weight: bold;
  color: #333;
}

.certificate-content {
  background-color: #fff;
  border-radius: 10rpx;
  padding: 30rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
}

.info-item {
  display: flex;
  padding: 20rpx 0;
  border-bottom: 1rpx solid #f0f0f0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  width: 240rpx;
  font-size: 28rpx;
  color: #666;
  display: flex;
  align-items: center;
}

.info-value {
  flex: 1;
  font-size: 28rpx;
  color: #333;
  word-break: break-all;
}

.highlight {
  color: #e64340;
  font-weight: bold;
}

.footer {
  margin-top: 30rpx;
  text-align: center;
  padding: 20rpx 0;
}

.footer-text {
  font-size: 24rpx;
  color: #999;
}
</style>